color1=240
color2=22

git_branch() {
    branch="$(git branch 2>/dev/null | \grep '\*' | awk '{print $2}')"

    if [[ $branch == "" ]]; then
        :
    else
        echo "%K{$color2}[$branch]%k"
    fi
}

user="%K{$color1}%n%K"
in="%K{$color1} in %K"
host="%K{$color1}%m%k"
lb="%K{$color1}[%k"
rb="%K{$color1}]%k"
col="%K{$color1}:%k"
dir="%K{$color1}%d%k"

PROMPT='${lb}${user}${in}${host}${col}${dir}${rb}$(git_branch)'
